'use strict';

const Controller = require('egg').Controller

class codeController extends Controller {
    async create() {
        const {
            ctx,
        } = this;
        ctx.body = await ctx.service.code.create(ctx.request.body);
    }

    async delete() {
        const {
            ctx,
        } = this;
        ctx.body = await ctx.service.code.delete(ctx.request.body);
    }

    // 获取列表
    async list() {
        const {
            ctx,
        } = this
        ctx.body = await ctx.service.code.findList(ctx.request.query)
    }

    async update() {
        const {
            ctx,
        } = this;
        ctx.body = await ctx.service.code.update(ctx.request.body);
    }


}

module.exports = codeController;
